Keir Fraser [Wed, 21 Oct 2009 15:05:05 +0000 (16:05 +0100)]
Remove unused XEN_DOMINF_cpu{mask,shift} definitions.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Wed, 21 Oct 2009 08:23:10 +0000 (09:23 +0100)]
xend: bootable flag of VBD not always of type int
1. Calling VDB.set_bootable(True) results in string 'True' in managed
config file. After xend restart, conversion int(bootable) in
server/blkif.py fails.
2. selection of bootable disks in XendDomainInfo.py requires
type(bootable) == int not str, otherwise all disks are taken as
bootable.
This patch converts the bootable flag always to int.
Signed-off-by: Lutz Dube <Lutz.Dube@ts.fujitsu.com>
Keir Fraser [Wed, 21 Oct 2009 08:21:01 +0000 (09:21 +0100)]
xmalloc_tlsf: Fall back to xmalloc_whole_pages() if xmem_pool_alloc() fails.
This was happening for xmalloc request sizes between 3921 and 3951
bytes. The reason being that xmem_pool_alloc() may add extra padding
to the requested size, making the total block size greater than a
page.
Rather than add yet more smarts about TLSF to _xmalloc(), we just
dumbly attempt any request smaller than a page via xmem_pool_alloc()
first, then fall back on xmalloc_whole_pages() if this fails.
Based on bug diagnosis and initial patch by John Byrne <john.l.byrne@hp.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Wed, 21 Oct 2009 07:51:10 +0000 (08:51 +0100)]
stubdom: implement pci coldplug
This patch fixes the circular dependency problem in the toolstack that
prevented pci coldplug from working with stubdoms: after creating the
stubdom we wait for it to be properly initialized before going
further. We release the domain lock while we wait.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Keir Fraser [Wed, 21 Oct 2009 07:50:23 +0000 (08:50 +0100)]
x86: MSI: Mask/unmask msi irq during the window which programs msi.
When program msi, it has to mask it first, otherwise, it
may generate inconsistent interrupts. According to spec,
if not masked, the interrupt generation behaviour is undefined.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Keir Fraser [Tue, 20 Oct 2009 13:36:01 +0000 (14:36 +0100)]
Obtain Linux kernel via git protocol by default (GIT_HTTP=y overrides)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Tue, 20 Oct 2009 09:23:28 +0000 (10:23 +0100)]
Fix nomigrate option implementation so that Xen builds.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Tue, 20 Oct 2009 07:45:12 +0000 (08:45 +0100)]
Add nomigrate config option to disable migration/restore
The new nomigrate option can be set to non-zero in vm.cfg
(for both hvm and pvm) to disallow a guest from being
migrated or restored. (Save is still allowed for the purpose
of checkpointing.) The option persists into a save file
and is also communicated into the hypervisor, the latter
for the purposes of a to-be-added hypercall for communicating
to guests that migration is disallowed (which will be
used initially for userland TSC-related sensing, but may
find other uses).
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Keir Fraser [Tue, 20 Oct 2009 07:43:27 +0000 (08:43 +0100)]
xend: Cast oos flag to int before arithmetic.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 19 Oct 2009 15:50:14 +0000 (16:50 +0100)]
vtd: Disable VT-d if no DRHD units are probed.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 19 Oct 2009 12:31:21 +0000 (13:31 +0100)]
vtd: A few cleanups to avoid dereferencing NULL drhd pointers.
In most cases I simply remove the reference since it is never actually
used.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 19 Oct 2009 12:03:03 +0000 (13:03 +0100)]
Revert 20338:
5f28661bb2bb
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 19 Oct 2009 10:58:36 +0000 (11:58 +0100)]
Allow guests to register secondary vcpu_time_info
Allow a guest to register a second location for the VCPU time info
structure for each vcpu. This is intended to allow the guest kernel
to map this information into a usermode accessible page, so that
usermode can efficiently calculate system time from the TSC without
having to make a syscall.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 19 Oct 2009 09:57:58 +0000 (10:57 +0100)]
vt-d: do not enable VT-d on acpi=off
This reverts changeset 20323:
2370e16ab6d3 and adds a small
check to iommu_setup() which should more correctly cover all cases.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Keir Fraser [Mon, 19 Oct 2009 09:56:58 +0000 (10:56 +0100)]
x86 shadow: Update cr3 in PAE mode when guest walk succeed but shadow walk fails
When running in PAE mode, Windows 7 (apparently) will occasionally
switch cr3 with one of the L3 entries invalid, make it valid, and then
expect the hardware to load the new value. (This behavior is
explicitly not promised in the hardware manuals.) This leads to a
situation where on a shadow fault, the guest walk succeeds but the
shadow walk fails. The code assumes this can only happen when the
domain is dying, and makes an ASSERT() to that effect. So currently,
in debug mode, this will cause the host to crash; in non-debug mode,
this will cause a page-fault loop.
This patch solves the problem by calling update_cr3() in that path
when the guest is in PAE mode, and only ASSERT()ing when the guest is
not in PAE mode. The guest will get one spurious page fault, but
subsequent accesses will succeed.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Keir Fraser [Mon, 19 Oct 2009 09:55:46 +0000 (10:55 +0100)]
Per-domain switch to disable oos shadow page tables
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Keir Fraser [Mon, 19 Oct 2009 09:54:35 +0000 (10:54 +0100)]
[IOMMU] clean interrupt remapping and queued invalidation
This patch enlarges interrupt remapping table to fix the out-of range
table access when using many multiple-function PCI devices.
Invalidation queue is also expanded.
Signed-Off-By: Zhai Edwin <edwin.zhai@intel.com>
Signed-Off-By: Cui Dexuan <dexuan.cui@intel.com>
Keir Fraser [Mon, 19 Oct 2009 09:50:46 +0000 (10:50 +0100)]
x86: vMSI: Fix msi irq affinity issue for hvm guest.
There is a race between guest setting new vector and doing EOI on old
vector. Once guest sets new vector before its doing EOI on vector,
when guest does eoi, hypervisor may fail to find the related pirq, and
hypervisor may miss to EOI real vector and leads to system hang. We
may need to add a timer for each pirq interrupt source to avoid host
hang, but this is another topic, and will be addressed later.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Keir Fraser [Mon, 19 Oct 2009 09:49:23 +0000 (10:49 +0100)]
gdbsx: malloc extra bye for null char
Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Keir Fraser [Mon, 19 Oct 2009 09:48:47 +0000 (10:48 +0100)]
xm,xend: Add commands to hotplug usb devices to hvm guests
Signed-off-by: James Song Wei <jsong@novell.com>
Keir Fraser [Mon, 19 Oct 2009 09:47:09 +0000 (10:47 +0100)]
xm: Fix xm network2-{attach,detach}
"xm help" is aborted due to a missing comma.
Some fixes in passing.
- less help message.
- typo.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Keir Fraser [Fri, 16 Oct 2009 08:04:53 +0000 (09:04 +0100)]
xend: Implement VBD.media_change
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Keir Fraser [Fri, 16 Oct 2009 07:36:22 +0000 (08:36 +0100)]
xm: Use 'vifname' config option to construct a qemu tap name.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Keir Fraser [Fri, 16 Oct 2009 07:35:21 +0000 (08:35 +0100)]
xend: Check no VBDs attached on VDI.destroy
We can destroy a VDI by VDI.destroy even if the VDI is being used
to VBDs. This patch checks that the VDI is not used to VBDs.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Keir Fraser [Fri, 16 Oct 2009 07:34:49 +0000 (08:34 +0100)]
x86: document tsc_native configuration option in xmexample.hvm.
Set the default value to 1
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Keir Fraser [Fri, 16 Oct 2009 07:32:34 +0000 (08:32 +0100)]
xm,xend: A few fixes for changeset 20314
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Keir Fraser [Fri, 16 Oct 2009 07:31:39 +0000 (08:31 +0100)]
x86: Update powernow.c to latest cpufreq code
The general cpufreq infrastructure has been improved over the
last year. Update the AMD PowerNow! driver powernow.c to
take advantage of those improvements.
Specifically, addresses Novell bugzilla # 530035.
Signed-of-by: Mark Langsdorf <mark.langsdorf@amd.com>
Keir Fraser [Fri, 16 Oct 2009 07:30:13 +0000 (08:30 +0100)]
xend: passthrough: do not check non-page-aligned MMIO BAR if not strict-check
When the option pci-passthrough-strict-check of
/etc/xen/xend-config.sxp is set to 'no', we don't check the
non-page-aligned MMIO BAR. This could be useful in some cases, e.g.,
when there is only 1 device in the range of the page and we try to
assign the device to pv guest.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Keir Fraser [Fri, 16 Oct 2009 07:28:47 +0000 (08:28 +0100)]
vt-d: Fixpanic in msi_msg_read_remap_rte with acpi=off
Xen panics when "acpi=off noacpi" is set. Problem is caused by
dereferencing NULL pointer in drhd after calling
acpi_find_matched_drhd_unit. As acpi_find_matched_drhd_unit can
return NULL, checks has to be done before returned value is used.
From: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
Keir Fraser [Fri, 16 Oct 2009 07:25:17 +0000 (08:25 +0100)]
x86: Fix ept and vt-d co-existence issue.
For vt-d's mmio address ranges, once ept enables, they should
be added to ept page tables with p2m lock held, and then guest can
access these ranges like conventional ram, but to change the ept
entries, it should take the p2m lock first.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Keir Fraser [Fri, 16 Oct 2009 07:24:47 +0000 (08:24 +0100)]
xend: add a description config item for each guest.
Add a new option "description=" to each VM to increase the
manageability of VM, which could be accessed via "xm list -l
MACHINE".e.g add "description='(name, james),(priority 5), (owner
james.song@company.com)'" to configure file, User can get the VM's
attribute easily by "xm list -l Machine" or some tools.
Signed-off-by: James Song<jsong@novell.com>
Keir Fraser [Thu, 15 Oct 2009 15:49:21 +0000 (16:49 +0100)]
Remove bogus call to get_domain_by_id() in do_domctl().
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
Keir Fraser [Thu, 15 Oct 2009 08:36:40 +0000 (09:36 +0100)]
gdbsx: a gdbserver stub for xen.
It should be run on dom0 on gdbsx enabled hypervisor. For details,
please see tools/debugger/gdbsx/README
Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Thu, 15 Oct 2009 07:31:08 +0000 (08:31 +0100)]
xm: Reuse VDI if location is same
In XenAPI mode, when we start a VM by using xm create command, VDIs
are always automatically created for VBDs. Once we shut down the
VM, then start the VM again, then VDIs are newly created. As a
result, a vdi.xml file continues to expand.
This patch reuses VDIs if location of the VDIs is same.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Keir Fraser [Thu, 15 Oct 2009 07:30:31 +0000 (08:30 +0100)]
x86: Remove unused temporay variable 'old_gvec'.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Keir Fraser [Thu, 15 Oct 2009 07:29:33 +0000 (08:29 +0100)]
lockprof: Fix x86_32 build and clean up coding style
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Thu, 15 Oct 2009 07:16:42 +0000 (08:16 +0100)]
xend: destroy stubdoms synchronously
This patch makes the destruction of stubdoms a synchronous event,
therefore it is no longer possible to run out of memory when rebooting
a guest because the stubdom of the old guest is always destroyed
before the creation of the new guest.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Keir Fraser [Wed, 14 Oct 2009 08:09:23 +0000 (09:09 +0100)]
xm,xend: Add new option "change_home_server" to xm migrate
This patch adds a new option to xm migrate command. A concept of the
option is inspired from XenServer/XenCenter. The concept is "Change
home server (affinity)." The option name is "change_home_server."
Currently, a config.sxp file of a managed domain is not migrated to a
destination server even if the migration of the managed domain
succeeds. The config.sxp file is kept in a source server.
By the patch, the config.sxp file is migrated with the managed domain.
The config.sxp file is unregistered from the source server, then the
config.sxp file is registered to the destination server.
BTW, should the config.sxp file be always migrated without the option?
If the managed domain is migrated without the option, the managed
domains exist on both the source server and the destination server.
(Of course, the managed domain on the source server is "halted" state,
and the managed domain on the destination server is "running" state.)
Is it good that the managed domains with a same UUID exist on both
servers? (In the patch, I added the option for compatible.)
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Keir Fraser [Wed, 14 Oct 2009 08:08:16 +0000 (09:08 +0100)]
Keir Fraser [Wed, 14 Oct 2009 08:07:51 +0000 (09:07 +0100)]
Spinlock profiling (enable in build with lock_profile=y)
Adds new tool xenlockprof to run from dom0.
From: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Wed, 14 Oct 2009 07:58:47 +0000 (08:58 +0100)]
minios: fix console end of line: \n\r -> \r\n
Change the end of line produced by minios' console from \n\r to \r\n.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Keir Fraser [Wed, 14 Oct 2009 07:56:55 +0000 (08:56 +0100)]
xend: call pci_device_configure on the stubdom
Whenever pci_device_configure is called on a guest that has a stubdom,
call pci_device_configure on the stubdom as well.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Keir Fraser [Wed, 14 Oct 2009 07:56:25 +0000 (08:56 +0100)]
xend: allow a device to be assigned to a guest and its stubdom
This patch allows a pci device to be passed through an HVM guest and
its own stubdom at the same time.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Keir Fraser [Wed, 14 Oct 2009 07:55:43 +0000 (08:55 +0100)]
minios: fix minios console
MiniOS' console_print tries to expand '\n' into "\n\r" in place,
causing page faults if the string resides in text.
Use a duplicate of the string instead.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Keir Fraser [Wed, 14 Oct 2009 07:54:58 +0000 (08:54 +0100)]
Add build option to allow more hypercalls from stubdoms
Stubdoms need to be able to make all the passthrough related
hypercalls on behalf of the guest (for now).
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Wed, 14 Oct 2009 07:33:11 +0000 (08:33 +0100)]
stubdom pcilib: define endianness for minios
Include endian.h for MiniOS.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Keir Fraser [Wed, 14 Oct 2009 07:31:07 +0000 (08:31 +0100)]
minios pcifront: translate physical into virtual addresses
Qemu understands physical pci addresses while pciback expects virtual
pci addresses: this patch adds a translation function in pcifront to
make the conversion.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Keir Fraser [Wed, 14 Oct 2009 07:29:56 +0000 (08:29 +0100)]
pv-on-hvm: Adjust mkbuildtree to handle pv_ops header placement
Due to the movement of the arch include directories, we need to adjust
where mkbuildtree looks for headers when building the pv drivers.
Also add a check for the location of features.c
Signed-off-by: Charles Arnold <carnold@novell.com>
Keir Fraser [Mon, 12 Oct 2009 11:56:00 +0000 (12:56 +0100)]
x86: reduce the uses of CONFIG_COMPAT
... to where it really is needed and meaningful (i.e. in some places
it seems to make more sense to use __x86_64__ instead).
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Keir Fraser [Fri, 9 Oct 2009 08:34:03 +0000 (09:34 +0100)]
x86: trust new architecturally-defined TSC Invariant bit on Intel systems
Trust new architecturally-defined TSC Invariant bit (on
Intel systems only for now, AMD TBD).
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Fri, 9 Oct 2009 08:33:29 +0000 (09:33 +0100)]
x86: Fix build after ia64 grant-table build fix.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Fri, 9 Oct 2009 07:56:43 +0000 (08:56 +0100)]
xend: Fix VDI-VBD link for XenAPI
I detected problems of VDI-VBD link again.
- In the case of inactive managed domains, VDI->VBD link was lost
by xend restarting (or host OS rebooting).
- In the case of active domains, both VDI->VBD link and VBD->VDI
link were lost by xend restarting.
When xend is restarted, information of VDI instances is restored from
a vdi.xml file. But the vdi.xml file does not have UUID of VBD
because xend does not write the UUID to the vdi.xml file. Therefore,
VDI->VBD link is lost. When xend is restarted, information of VBD
instances is restored from xenstore. But xenstore does not have UUID
of VDI. Therefore, VBD->VDI link is lost.
This patch solves the problems. VDI instances stop having UUID of
VBD. Instead, xend gathers UUID of VBD each time it's required. The
method is the same as Network->VIF link. Information of VBD instances
is restored not only from xenstore but from a config.sxp file. UUID
of VDI is restored from the config.sxp file.
FYI, VBD->VDI link of inactive managed domains is not lost because
information of VBD instances is restored from the config.sxp file.
UUID of VDI is written by xend to the config.sxp file.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Keir Fraser [Fri, 9 Oct 2009 07:55:43 +0000 (08:55 +0100)]
blktap2: Check gcrypt library has MD5() function.
From: Dulloor <dulloor@gmail.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Fri, 9 Oct 2009 07:54:25 +0000 (08:54 +0100)]
Fix the IA64 build of the hypervisor.
This is completely untested, beyond confirming that it compiles.
Signed-off-by: Steven Smith <steven.smith@citrix.com>
Keir Fraser [Fri, 9 Oct 2009 07:53:42 +0000 (08:53 +0100)]
xend: Fix bug in superpage flag handling
During testing I discovered that using a bootloader magically clears
the superpage flag out of the config. This small patch fixes that
behavior.
From: Dave McCracken <dcm@mccr.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Thu, 8 Oct 2009 08:24:32 +0000 (09:24 +0100)]
Obtain Linux kernels via git-over-http
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Thu, 8 Oct 2009 07:51:51 +0000 (08:51 +0100)]
x86 tsc: Fix check_tsc_warp() bug and add copyright notice
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Thu, 8 Oct 2009 07:48:52 +0000 (08:48 +0100)]
xsm: Correct the usage of XSM_ENABLE after c/s 20285.
Signed-off-by : Machon Gregory <mbgrego@tycho.ncsc.mil>
Keir Fraser [Thu, 8 Oct 2009 07:47:11 +0000 (08:47 +0100)]
Keir Fraser [Wed, 7 Oct 2009 15:29:03 +0000 (16:29 +0100)]
x86 shadow: Fix the build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Wed, 7 Oct 2009 15:10:19 +0000 (16:10 +0100)]
libxenctrl: Fix non-Linux definitions of xc_gnttab_map_table*().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Wed, 7 Oct 2009 14:58:26 +0000 (15:58 +0100)]
Fix hypervisor crash with unpopulated NUMA nodes
On NUMA systems with memory-less nodes Xen crashes quite early in the
hypervisor (while initializing the heaps). This is not an issue if
this happens to be the last node, but "inner" nodes trigger this
reliably. On multi-node processors it is much more likely to leave a
node unequipped. The attached patch fixes this by enumerating the
node via the node_online_map instead of counting from 0 to num_nodes.
The resulting NUMA setup is still somewhat strange, but at least it
does not crash. In lowlevel/xc/xc.c there is again this enumeration
bug, but I suppose we cannot access the HV's node_online_map from this
context, so the xm info output is not correct (but xm debug-keys H
is). I plan to rework the handling of memory-less nodes later.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Keir Fraser [Wed, 7 Oct 2009 14:56:05 +0000 (15:56 +0100)]
x86 shadow: fix the check for having killed the guest in the fault handler.
We care only about when we have called domain_crash() (and therefore
shadow invariants may not hold) and shouldn't spuriously inject
pagefaults into guests that are shutting down for other reasons.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Keir Fraser [Wed, 7 Oct 2009 09:26:39 +0000 (10:26 +0100)]
libxenctrl: Build fix after gnttab_v2 changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Wed, 7 Oct 2009 07:42:50 +0000 (08:42 +0100)]
PVUSB: Update public header.
Signed-off-by: Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
Keir Fraser [Wed, 7 Oct 2009 07:07:06 +0000 (08:07 +0100)]
x86 hvm: On failed hvm_send_assist_req(), io emulation state should be
reset to HVMIO_none, as no IO is in flight.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Wed, 7 Oct 2009 06:50:20 +0000 (07:50 +0100)]
Scattered code arrangement cleanups.
- remove redundant declarations
- add/move prototypes to headers
- move things where they belong to
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Keir Fraser [Wed, 7 Oct 2009 06:47:50 +0000 (07:47 +0100)]
Tools-side support for creating and destroying netchannel2 interfaces.
Signed-off-by: Steven Smith <steven.smith@citrix.com>
Keir Fraser [Wed, 7 Oct 2009 06:47:21 +0000 (07:47 +0100)]
Transitive grant support.
Signed-off-by: Steven Smith <steven.smith@citrix.com>
Keir Fraser [Wed, 7 Oct 2009 06:46:59 +0000 (07:46 +0100)]
Implement sub-page grant support.
Signed-off-by: Steven Smith <steven.smith@citrix.com>
Keir Fraser [Wed, 7 Oct 2009 06:46:36 +0000 (07:46 +0100)]
Introduce a grant_entry_v2 structure.
Signed-off-by: Steven Smith <steven.smith@citrix.com>
Keir Fraser [Wed, 7 Oct 2009 06:46:14 +0000 (07:46 +0100)]
Rename the struct grant_entry to struct grant_entry_v1, so that it
isn't in the way when we introduce struct grant_entry_v2.
Signed-off-by: Steven Smith <steven.smith@citrix.com>
Keir Fraser [Wed, 7 Oct 2009 06:45:39 +0000 (07:45 +0100)]
Optimize memcpy for x86 arch. If source buffers does not start at a 64
bit boundary, copy a few bytes at the beginnig up to next 64-bit
boundary and then does an aligned copy for the remaining data. This
can reduce the copy cost by up to 50%.
Signed-off-by: Jose Renato Santos <jsantos@hpl.hp.com>
Keir Fraser [Wed, 7 Oct 2009 06:45:14 +0000 (07:45 +0100)]
Slightly more accurate dependency tracking for the .c and .h files in
include/compat. They should depend on the scripts which generate
them, as well as the inputs to those scripts.
Signed-off-by: Steven Smith <steven.smith@citrix.com>
Keir Fraser [Wed, 7 Oct 2009 06:44:50 +0000 (07:44 +0100)]
Simplify include/xen/grant_table.h a bit:
-- INITIAL_GRANT_ENTRIES is never used, so can be removed.
-- Simplify num_act_frames_from_sha_frames a little.
Signed-off-by: Steven Smith <steven.smith@citrix.com>
Keir Fraser [Wed, 7 Oct 2009 06:43:50 +0000 (07:43 +0100)]
x86 vtsc: use debug-key to check/test reliable tsc
Previous attempt was rejected as too intrusive, but
further app rdtsc optimization work is very dependent
on Xen being able to determine if TSC is reliable
or not.
This patch starts to introduce the concept of
X86_FEATURE_TSC_RELIABLE as it is defined and
used by Linux, but uses it and tests it only in
a debug-key for now, so that a wide variety of
hardware can be measured by the broader Xen
community to confirm/deny TSC assumptions.
The eventual goal is for the evaluation of
TSC reliability to be exported to userland
so that apps can use rdtsc natively if and when
it is safe to do so.
(See http://lists.xensource.com/archives/html/xen-devel/2009-10/msg00056.html)
Note that the original Linux code for tsc_sync.c
uses a raw spinlock to ensure the "fastest, inlined,
non-debug version of a critical section". Xen
doesn't provide a _raw_spin_lock() so I used
regular spinlocks, but I would prefer the code
to use something more strict as Linux does.
(Also includes a minor nit: "NOSTOP" was used in
an early version of a Linux patch, but mainline
now uses "NONSTOP"... correct this for consistency.)
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Keir Fraser [Wed, 7 Oct 2009 06:35:06 +0000 (07:35 +0100)]
hvm, vtsc: missing vtsc counter for hvm guests
This counter line got dropped somewhere along the way.
Confused me a bit because the count was always being
reported as 0.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Keir Fraser [Wed, 7 Oct 2009 06:21:31 +0000 (07:21 +0100)]
x86 hvm: Do not incorrectly retire an instruction emulation when a
read/write cycle to qemu is dropped due to guest suspend.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Tue, 6 Oct 2009 09:11:53 +0000 (10:11 +0100)]
xend: Updated setpolicy to support loading of flask policy
Updated xm setpolicy command to support the loading of flask security
policies.
Signed-off-by : Machon Gregory <mbgrego@tycho.ncsc.mil>
Signed-off-by : George S. Coker, II <gscoker@alpha.ncsc.mil>
Keir Fraser [Tue, 6 Oct 2009 09:11:14 +0000 (10:11 +0100)]
[VTD] don't enable device ATS if root port does not support it
Fixed a bug in the code that enables ATS capability on the device even
when root port does not support it.
Signed-off-by: Allen Kay <allen.m.kay@intel.com>
Keir Fraser [Tue, 6 Oct 2009 09:09:21 +0000 (10:09 +0100)]
x86: Emulated TSC should run at same (1GHz) rate in guest kernel and apps.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Fri, 2 Oct 2009 08:10:27 +0000 (09:10 +0100)]
credit scheduler: fix credits overflow
In changing credits-per-tick from 100 to
1000000, a possible overflow
was introduced in the accounting algorithm, when credit totals (which
can be in the millions) gets multiplied by a weight (typically 256):
th eresult can easily overflow a signed 32-bit variable.
Fix this by reverting to 100 credits per tick, and maintain long-term
fairness/correctness by tracking at the nanosecond level exactly how
much execution time has been accounted to each VCPU. We do this by
rounding execution time so far to nearest number of credits, but then
remember the VCPU's 'partial credit balance'.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Thu, 1 Oct 2009 11:29:33 +0000 (12:29 +0100)]
Fix recursive lock p2m lock acquisition in POD code
The POD code can take the p2m lock from inside a lookup. This causes
a crash if anyone calls gfn_to_mfn* with the p2m lock held, which is
quite a few places. Make the POD code understand that it may be
called with the lock held, and DTRT about talking or releasing it.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Keir Fraser [Thu, 1 Oct 2009 11:28:54 +0000 (12:28 +0100)]
stubdom/minios: re-structure headers
As part of making stubdom usable on NetBSD, it is necessary to
restructure the minios headers to avoid conflicts with NetBSD's
crossbuild toolchain.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Keir Fraser [Thu, 1 Oct 2009 11:27:01 +0000 (12:27 +0100)]
VNIF: Using smart polling instead of event notification.
Patch the Xen version of ring.h
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Keir Fraser [Thu, 1 Oct 2009 11:26:15 +0000 (12:26 +0100)]
Fix memory leak in libxenstore python bindings
Temporary tuple0 python object was not freed at the end of
xspy_set_permissions() in case no error occurred. To reduce code
duplication, this path reuses the cleanup code.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Keir Fraser [Thu, 1 Oct 2009 11:25:36 +0000 (12:25 +0100)]
Disable HPET broadcast mode on kexec.
Without this the new kernel cannot receive timer interrupts from the
legacy sources. Hangs are observed in the second kernel's
"check_timer()" routing or at "Checking 'hlt' instruction."
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Keir Fraser [Wed, 30 Sep 2009 07:51:21 +0000 (08:51 +0100)]
xend: allow domain creation with multiple empty CD-ROM devices
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Wed, 30 Sep 2009 07:44:57 +0000 (08:44 +0100)]
xend: Fix memory leaks in libxc python bindings
Reference counters are not correctly decreased for python object in
several places in python bindings for libxc. Most of them are around
PyList_Append(), which unlike PyList_SetItem() does increment
reference counter of the object being added to a list.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Keir Fraser [Wed, 30 Sep 2009 07:43:34 +0000 (08:43 +0100)]
Cleanup: Make local functions static and remove unused functions.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Keir Fraser [Tue, 29 Sep 2009 10:28:33 +0000 (11:28 +0100)]
svm: a few cleanups
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Keir Fraser [Tue, 29 Sep 2009 10:27:53 +0000 (11:27 +0100)]
vmx: add the support of XSAVE/XRSTOR to VMX guest
XSAVE/XRSTOR manages the existing and future processor extended states
on x86 architecture.
The XSAVE/XRSTOR infrastructure is defined in Intel SDMs:
http://www.intel.com/products/processor/manuals/
The patch uses the classical CR0.TS based algorithm to manage the
states on context switch. At present, we know 3 bits in the
XFEATURE_ENABLED_MASK: FPU, SSE and YMM. YMM is defined in Intel AVX
Programming Reference: http://software.intel.com/sites/avx/
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Keir Fraser [Tue, 29 Sep 2009 10:22:17 +0000 (11:22 +0100)]
mce: Support machine check logging left over from previous reset.
Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
Keir Fraser [Mon, 28 Sep 2009 12:59:35 +0000 (13:59 +0100)]
xend: Fix save/restore after previous changeset.
Platform variable 'tsc_native' is saved/restored as a string, so must
be converted to an integer before passing to domain_set_tsc_native().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 28 Sep 2009 09:01:10 +0000 (10:01 +0100)]
x86: Allow TSC mode (emulate vs native) to be configured per domain.
The default is to emulate. Old saved images will be restored with
legacy behaviour however (native TSC, no emulation).
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 28 Sep 2009 07:28:26 +0000 (08:28 +0100)]
AMD IOMMU: Fix boot output on non-iommu system
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Keir Fraser [Fri, 25 Sep 2009 14:20:58 +0000 (15:20 +0100)]
x86 hvm: *really* fix missing ticks bug of c/s 20218
With c/s 20218, timer ticks might be missed when IRQs of a timer are
queued. "Next scheduled time" is accumulated wrongly.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Fri, 25 Sep 2009 14:12:45 +0000 (15:12 +0100)]
ia64: Fix build for xen/ia64
Define the related dummy functions and move the macros
as public to fix the build issue.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Keir Fraser [Fri, 25 Sep 2009 09:50:18 +0000 (10:50 +0100)]
x86: Make assigned devices' interrupts delivery to right vcpu.
This patch targets for reducing IPIs when delivery VT-d's devices'
intrs to target vcpus. According to the experiments leveraging 10G
Oplin NIC card, CPU utilization can reduce 5%-6% and NIC's bandwidth
keeps unchanged through testings. And this patch can always benefit
UP guests with MSI-capable devices assigned and SMP guests whose
lapic's destination mode is physical mode. And also it can benefit
SMP guests whose lapic's dest_mode is logical mode but only one
destination is specified. So it should cover major cases in real
environment. Currenlty, this patch intercepts the programming for MSI
intr status, and caculate the destination id for the pirq when do the
programming in advance. When vcpu migratio n occurs or guest
re-programe MSI status, it checks that whether needs to set the
corresponding pirq's affinity of assigned devices and make vcpu's
affinity and pirq's consistent to reduce the IPIs eventually.
Signed-off-by : Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
Keir Fraser [Fri, 25 Sep 2009 09:47:36 +0000 (10:47 +0100)]
PoD: Allocate 4k pages if 2 meg allocation fails
In p2m_pod_set_cache_target:
* If a 2-meg allocation fails, try a 4k allocation
* If both allocations fail, return -ENOMEM so that the domain build
will fail.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>